import useRequest from '../hook/request';

// 订单详情
export function getOrderDetailApi(params: any, id: number) {
  return useRequest(
  `pay/order/getOrderDetail/${id}`,
    params,
    'GET'
  )
}

type UpdataDetailsType = {
  id: number,
  doctorId: number,
  nurseId?: number,
  consultantId?: number,
  netConsultantId?: number
}
type UpDataOrderInfoType = {
  id: number,
  createTime: string,
  remark?: string,
  details: UpdataDetailsType[]
}


// 修改订单基础信息
export function updateOrderInfoApi(params: UpDataOrderInfoType) {
  return useRequest(
  `pay/order/updateOrderInfo`,
    params,
    'POST'
  )
}

// 修改收费记录基本信息
export function updateOrderPayLogInfoApi(params: any) {
  return useRequest(
  `pay/order/updateOrderPayLogInfo`,
    params,
    'POST'
  )
}

// 删除划价订单
export function delOrderApi(params: any, id:number) {
  return useRequest(
  `pay/order/delOrder/${id}`,
    params,
    'POST'
  )
}

// 删除订单
export function delOrderHasPayApi(params: any, id:number) {
  return useRequest(
  `pay/order/delOrderHasPay/${id}`,
    params,
    'POST'
  )
}

